﻿<%@ Page Language="C#" MasterPageFile="~/Users/Users.Master" AutoEventWireup="true" CodeBehind="TeamDetail.aspx.cs" Inherits="Pantry.Web.Users.TeamDetail" Title="Team Detail" %>
<%@ Register TagPrefix="uc" TagName="ListContact" Src="~/Users/Controls/ListContact.ascx" %>
<%@ Register TagPrefix="uc1" TagName="ListTypeOfBusiness" Src="~/Users/Controls/ListTypeOfBusiness.ascx" %>
<%@ Register TagPrefix="uc2" TagName="ListPostcode" Src="~/Users/Controls/ListPostcode.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="Resources/js/DataTables/jquery.dataTables.min.js" type="text/javascript"></script>
	<!---->
	<script type="text/javascript" src="Resources/pop-up/Alert/javaAlert.js"></script>
    <!---->
    <script language="javascript" type="text/javascript">
    function validate() {
    	if (document.getElementById("ctl00_ContentPlaceHolder1_TextBoxTeamName").value==""){
		    showmessage('Please input Team name !', 'ERROR', '', 'false');
		    return false;
    	}
    	return true;
    }
    
    function validate1() {
		    showmessage('Please input Team name !', 'ERROR', '', 'false');
		    return false;
    }
    
    function notify(message,title,isRedirect,urlRedirect) {
    	showmessage(message, title, urlRedirect, isRedirect);
	    return false;
    }
    
    </script>
    
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <asp:Label ID="LabelNotify" runat="server" Text=""></asp:Label>
    
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ButtonLoopUpTypeOfBusiness" EventName="Click" />
            <asp:PostBackTrigger ControlID="ButtonLookupContact"/>
            <%--<asp:PostBackTrigger ControlID="ButtonBack"/>--%>
        </Triggers>
        <ContentTemplate>    
	        <div class="g_12">
        	
		        <div class="widget_header">
        			<asp:Label runat="server" Text="Create Team" CssClass="widget_header_title wwIcon i_16_data" ID="LabelTitle"></asp:Label>
			        
                    <asp:Button ID="ButtonBack" runat="server" Text="Back" CssClass="simple_buttons right_buttons" OnClick="ButtonBackOnClicked"
                                                 />
                    <asp:Button ID="ButtonSave" runat="server" Text="Save" CssClass="simple_buttons right_buttons" OnClick="ButtonSaveOnClicked"
                                                 />
                    <asp:Button ID="ButtonDeactivate" runat="server" Text="In-active" 
                                                CssClass="simple_buttons right_buttons" OnClick="ButtonActiveClicked"
                         OnClientClick="return confirmDialogue();" />
			        <div class="clear"></div>
		        </div>
		        <div class="widget_contents noPadding">	
			        <div class="form_contents">
        			    
			            <!--Column 1-->
				        <div class="form_enter">
				            <asp:HiddenField ID="HiddenFieldDepartmentId" runat="server" Visible="False"></asp:HiddenField>
				            <asp:HiddenField ID="HiddenFieldOrganizationId" runat="server" Visible="False"></asp:HiddenField>
				            <asp:HiddenField ID="HiddenFieldTeamId" runat="server" Visible="False"></asp:HiddenField>
				            <asp:HiddenField ID="HiddenFieldIsActive" runat="server" Value="true" Visible="False"></asp:HiddenField>
					        <div class=" lable_first_input">Team Name<span style="color:Red">&nbsp;&nbsp; *</span></div>
					        <div class="form_input" id="ProgramName">
                                <asp:TextBox ID="TextBoxTeamName" runat="server" CssClass="simple_field"></asp:TextBox>                                    
					        </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">Type of business</div>
					        <div class="form_input_short" id="Contact">
					            <asp:TextBox ID="TextBoxTypeName"  runat="server" CssClass="simple_field input_disable" 
                                     Enabled="False"></asp:TextBox>
                                    <asp:HiddenField ID="HiddenFieldTypeOfBusinessId" runat="server" />
					        </div>
				            <div class="lookup_popup">
                                <asp:Button ID="ButtonLoopUpTypeOfBusiness" runat="server" Text="Lookup" CssClass="simple_buttons lookupBusiness"/>
				            </div>
				        </div>
				        <div class="clear"></div>
        				
			            <!--Column 2-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Team short description</div>
					        <div class="form_input" id="Description">
                                <asp:TextBox ID="TextBoxShortDescription" runat="server" CssClass="height60" 
                                    Rows="2" TextMode="MultiLine"></asp:TextBox>
                                
					        </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">SIC Code</div>
					        <div class="form_input_very_short" id="Div2">
					            <asp:TextBox ID="TextBoxSicCode"  runat="server" CssClass="simple_field input_disable" 
                                     Enabled="False"></asp:TextBox>
                                    <asp:HiddenField ID="HiddenField1" runat="server" />
					        </div>
				        </div>
				        <div class="clear"></div>
        				
			            <!--Column 3-->
				        <div class="form_enter">
				            <div class="">
					            <div class=" lable_first_input">Lead Contact</div>
					            <div class="form_input_short" id="Div3">
					                <asp:TextBox ID="TextBoxContactName"  runat="server" CssClass="simple_field input_disable" 
                                         Enabled="False"></asp:TextBox>
                                        <asp:HiddenField ID="HiddenFieldContactId" runat="server" />
					            </div>
					            <div class="lookup_popup">
                                    <asp:Button ID="ButtonLookupContact" runat="server" Text="Lookup" CssClass="simple_buttons lookupcontact"/>
					            </div>
        					    
					            <div class="clear"></div>
                                
			                </div>
				            <div class="sub_form_left">
					            <div class=" lable_first_input">Copy Address from</div>
                                  <asp:RadioButtonList id="RadioButtonCopyAddress" runat="server" 
                                      RepeatDirection="Horizontal" CssClass="simple_form"  
                                      AutoPostBack="True"
                                      onselectedindexchanged="RadioButtonCopyAddressSelectedIndexChanged" >
                                     <asp:ListItem Value="1">Organisation</asp:ListItem>
                                     <asp:ListItem Value="2">Parent</asp:ListItem>
                                  </asp:RadioButtonList>
					            <div class="clear"></div>
			                </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">Team full description</div>
					        <div class="form_input" id="Div4">
                                <asp:TextBox ID="TextBoxFullDescription" runat="server" CssClass="height60" 
                                    Rows="2" TextMode="MultiLine"></asp:TextBox>
                                
					        </div>
				        </div>
				        <div class="clear"></div>
        				 
			            <!--Column 4-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Address 1</div>
					        <div class="form_input" id="Div1">
                                <asp:TextBox ID="TextBoxAddress1" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">Phone</div>
					        <div class="form_input" id="Div5">
                                <asp:TextBox ID="TextBoxPhone" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="clear"></div>
        				
			            <!--Column 5-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Address 2</div>
					        <div class="form_input" id="Div6">
                                <asp:TextBox ID="TextBoxAddress2" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">Fax</div>
					        <div class="form_input" id="Div7">
                                <asp:TextBox ID="TextBoxFax" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="clear"></div>
        				
			            <!--Column 6-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Address 3</div>
					        <div class="form_input" id="Div8">
                                <asp:TextBox ID="TextBoxAddress3" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">Email</div>
					        <div class="form_input" id="Div9">
                                <asp:TextBox ID="TextBoxEmail" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="clear"></div>
        				
			            <!--Column 7-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Postcode</div>
					        <div class="form_input_short_show" id="Div10">
					            <asp:TextBox ID="TextBoxPostcode"  runat="server" CssClass="simple_field"></asp:TextBox>
                                    <asp:HiddenField ID="HiddenFieldPostcode" runat="server" />
					        </div>
				            <div class="lookup_popup">
                                <asp:Button ID="ButtonLoopUpPostcode" runat="server" Text="Lookup" CssClass="simple_buttons lookupPostcode"/>
				            </div>
				        </div>
				        <div class="form_enter">
					        <div class=" lable_first_input">Web Address</div>
					        <div class="form_input" id="Div11">
                                <asp:TextBox ID="TextBoxWebAddress" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="clear"></div>
        				
			            <!--Column 8-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Town/Village/City</div>
					        <div class="form_input" id="Div12">
                                <asp:TextBox ID="TextBoxTownVillageCity" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="clear"></div>
				        <div class="form_enter">
					        <div class=" lable_first_input">County</div>
					        <div class="form_input" id="Div13">
                                <asp:TextBox ID="TextBoxCounty" runat="server" CssClass="simple_field"></asp:TextBox>
					        </div>
				        </div>
				        <div class="clear"></div>
				        
			            <!--Column 9-->
				        <div class="form_enter">
					        <div class=" lable_first_input">Nation/Country</div>
					        <asp:DropDownList CssClass="selector selector_standar" ID="DropDownListCountry" runat="server">
        					    
					        </asp:DropDownList>
				        </div>
				        <div class="clear"></div>
			        </div>
		        </div>	
	        </div>
	        
        </ContentTemplate>
    </asp:UpdatePanel>
    	
	
	<script type="text/javascript">
	    function confirmDialogue(){
	        if(confirm('Do you want to make this Program in-active?'))
	            return true;
	        return false;
	    }
	    
	    
		var frmvalidator  = new Validator("aspnetForm");
		//frmvalidator.EnableOnPageErrorDisplay();
		//frmvalidator.EnableMsgsTogether();
		var programName = document.getElementById('ProgramName').getElementsByTagName("input")[0].id;
		frmvalidator.addValidation(programName,"req","Please provide your Program Name");
		
		var contact = document.getElementById('Contact').getElementsByTagName("input")[0].id;
		frmvalidator.addValidation(contact,"req","Please provide your ContactId");		
	</script>
    
	<div class="dialog DialogListContact" style="display:none;" title="Lookup Contact">
        <uc:ListContact runat="server" ID="ListContact" />
        <div class="clear"></div>
    </div>
    <div class="dialog DialogListOfBusiness" style="display:none;" title="Lookup Type Of Business">
        <uc1:ListTypeOfBusiness runat="server" ID="ListTypeOfBusiness" />
        <div class="clear"></div>
    </div>
    <div class="dialog DialogListOfPostCode" style="display:none;" title="Lookup Type Postcode">
        <uc2:ListPostcode runat="server" ID="ListPostcode" />
        <div class="clear"></div>
    </div>
    <a href="#" class="showmessage hasheader"></a>
</asp:Content>
